﻿using System.Data;
using Crosland.Offline.Core;
using Crosland.Framework.Base;

namespace Crosland.Offline.Data.Helper
{
    public class AlmacenHelper : DaoHelperBase
    {
        public AlmacenHelper()
            : base(Entidad, ConstansBase.Aplicacion)
        {
        }

        public Almacen Create(IDataReader dr)
        {
            Almacen entity = new Almacen();

            int iWerks = dr.GetOrdinal(this.Werks);
            if (!dr.IsDBNull(iWerks)) entity.Werks = dr.GetString(iWerks);

            int iLgort = dr.GetOrdinal(this.Lgort);
            if (!dr.IsDBNull(iLgort)) entity.Lgort = dr.GetString(iLgort);

            int iLgobe = dr.GetOrdinal(this.Lgobe);
            if (!dr.IsDBNull(iLgobe)) entity.Lgobe = dr.GetString(iLgobe);

            return entity;
        }


        #region Mapeo de Campos

        public const string Entidad = "Almacen";
        public string Werks = "WERKS";
        public string Lgort = "LGORT";
        public string Lgobe = "LGOBE";

        #endregion
    }
}
